1. Field of the Invention
The present invention relates to a white balance control device and a white balance control method, and more particularly to a white balance control device and a white balance control method that controls the white balance of an image based on the luminance and color-difference signal of the image.
2. Description of the Related Art
Image-capturing apparatuses using an image sensor, such as digital cameras and digital video cameras, have a white balance control function for adjusting the color tone of a captured image. The white balance control is processing for correcting pixel values based on a white balance coefficient (correction value) so as to capture an image of a white object as white.
The white balance control includes manual white balance control in which an image of an object that is desired to be captured as white is captured and then a white balance coefficient is obtained, and automatic white balance control in which a captured image is automatically detected for portions that are assumed to be white and then the white balance coefficient is obtained.
Conventional automatic white balance control is described in the following.
Signals output from an image sensor are digitized by A/D conversion, and as shown in FIG. 2, divided into a plurality of blocks.
Each block is composed of a color pixel of R, G, or B, and color evaluation values (Cx[i], Cy[i]) are obtained for each block, for example, by the computation formula (1) below.Cx[i]=(R[i]−B[i])/Y[i]×1024Cy[i]=(R[i]+B[i]−2G[i])/Y[i]×1024  (1)(where “i” is a block number; R[i], G[i], and B[i] are average values of the RGB pixel contained in the block “i”; and Y[i]=R[i]+2G[i]+B[i])
When a white detection region that is set in advance includes the color evaluation values (Cx[i], Cy[i]), it is determined that the block is white. Then, integral values SumR, SumG, and SumB of the color pixel contained in the block are computed, and white balance coefficients (WBCo_R, WBCo_G, and WBCo_B) are computed using the formula (2) below.WBCo—R=SumY×1024/sumR WBCo—G=SumY×1024/sumG WBCo—B=SumY×1024/sumB  (2)where SumY=(sumR+2×sumG+SumB)/4
However, in such white balance control, there are the following problems.
Under sunlight, the color evaluation value of white is distributed in the proximity of region A in FIG. 3. The color evaluation value of skin color under sunlight is distributed in region B, that is, a region that is substantially equivalent to the color evaluation value of the white point under a light source having a low color temperature.
Thus, in the case of an image containing less white color and more skin color, as in an up-close portrait, the color evaluation value obtained by using the aforementioned formula falls in region B in FIG. 3. As a result, there is a problem in that the skin color was mistakenly determined as white under a light source having a low color temperature, and a white balance coefficient for correcting the skin color to white is computed, leading to a miscorrection of human skin color to white. Similarly, in an image containing more chromatic colors that are close to the skin color, the chromatic colors are sometimes mistakenly determined as white, thereby mistakenly correcting the skin color to white.
For such a problem, when the luminance of a photographic subject is high, it is determined that the subject is under daylight (sunlight), and the region to be detected as white color (white detection region) is narrowed in order to not mistakenly determine the skin color as a white color under a light source having a low color temperature. However, when using low-illuminance fluorescent light having a high color temperature or fluorescent light having a medium color temperature as an indoor light source, the skin color is distributed below the black body radiation line (FIG. 3, region C). Therefore, in order to carry out the automatic white balance control for such fluorescent light, it is necessary to expand the white detection region, and there are cases where skin color is mistakenly determined as white.
Thus, Japanese Patent Laid-Open No. 2003-189325 proposes using a face detection technique to exclude the region detected as the face (face region) from the detection target of the white color pixel when carrying out white balance control.
However, in the white balance control method of Japanese Patent Laid-Open No. 2003-189325, there is no strategy for dealing with cases where the face region is wrongly detected, or cases where the face region cannot be detected. Thus, there is a problem in that when a region that is not a human face is incorrectly detected as a face region, the target region of white detection becomes smaller than necessary, leading to a decrease in the accuracy in color temperature information to be obtained and a further decrease in the accuracy in the white balance control.
Also, there is a problem in that when an up-close image of a human face is captured, or when many faces are included as in a group photo, the white detection target region becomes extremely small, decreasing accuracy in the white balance control.